package com.yuxl.admin.common.core.config;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestClient;
import org.springframework.web.client.RestTemplate;

/**
 * @date 2019/2/1 RestTemplate
 */
@AutoConfiguration
public class RestTemplateConfiguration {

	/**
	 * 动态 REST 模板
	 * @return {@link RestTemplate }
	 */
	@Bean
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}

	/**
	 * REST 客户端构建器（支持负载均衡）
	 * @return {@link RestClient.Builder }
	 */
	@Bean
	RestClient.Builder restClientBuilder() {
		return RestClient.builder();
	}

}
